package top.ddandang.blog.controller;


import top.ddandang.blog.bean.GlobalResponse;
import top.ddandang.blog.model.pojo.Journal;
import top.ddandang.blog.service.JournalService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author D
 * @since 2020-07-07
 */
@RestController
@RequestMapping("/journal")
public class JournalController {

    @Resource
    private JournalService journalService;

    @GetMapping("/listJournal")
    public GlobalResponse listJournal() {
        List<Journal> listJournal = journalService.listJournal();
        return GlobalResponse.success().data("listJournal", listJournal);
    }
}

